<?php
namespace Admin\Model;
use Frame\Libs\BaseModel;

class LoginModel extends BaseModel {
    
    // 验证用户名和密码
    public function verify($username, $password) {
        $sql = "SELECT password FROM `users` WHERE username=? LIMIT 1";
        $result = $this->pdo->fetchOne($sql, array($username));

        // 检查用户是否存在并且密码正确
        if ($result && $result['password'] === $password) {
            return true;
        }
        return false;
    }
}
